<template>
  <div class="box">
    <div class="f jcsb aic header">
      <el-icon
        class="ml30 mr25 pointer"
        color="#3E4850"
        :size="20"
        @click="back"
        ><Back
      /></el-icon>
      <div class="f14 f1 text-center">
        {{dataObj==null?"":dataObj.paperName }}
      </div>
<!--      <div class="f aic setting f12">-->
<!--        <div class="f aic pointer link">-->
<!--          <el-icon class="mr5"><Setting /></el-icon>-->
<!--          设置-->
<!--        </div>-->
<!--      </div>-->
    </div>
    <div class="main">
      <Score    v-if="dataObj!=null" :dataObj="dataObj" />
      <Analysis  v-if="dataObj!=null" :dataObj="dataObj"/>
    </div>
  </div>
</template>

<script setup lang="ts">
import { Back, Setting } from "@element-plus/icons-vue";
import Score from "./components/score.vue";
import Analysis from "./components/analysis.vue";
import {getReport} from "@/api/report/report";
const  dataObj = ref(null);
const route = useRouter();
const routeInfo = useRoute();
const id = ref(null);
id.value = routeInfo.query.id;
function loadData(){
  getReport(id.value).then(res=>{
    dataObj.value=res.data
    // dataObj.value.scoreDataCharts=[  {
    //   "date": "2025-04-20T00:00:00.000+08:00",
    //   "score": "1.0"
    // },  {
    //   "date": "2025-04-21T00:00:00.000+08:00",
    //   "score": "2.0"
    // },  {
    //   "date": "2025-04-23T00:00:00.000+08:00",
    //   "score": "4.0"
    // }]
    console.log(res);
  })
}
onMounted(() => {
  loadData(); // 初始化加载数据
});

const back = () => {
  history.back();
};
</script>
<style lang="scss" scoped>
.box {
  background: #f5f7fa;
  min-width: 1600px;
  min-height: 100vh;
  .header {
    height: 60px;
    background: #fff;
    padding: 0 130px;
    .setting {
      color: #3c464f;
    }
  }
  .main {
    padding: 0 130px 35px;
  }
}
</style>
